﻿@model yq.WebModel.File.FolderEdit
@Url.TreeScript()

@using (Ajax.BeginForm("DoEditFolder", new { }, new AjaxOptions { HttpMethod = "post", OnSuccess = "InitializeTipsEditFolder" }, new { id = "DoEditFolderId" }))
{ @Html.HiddenFor(obj => obj.FileinfoId)
    <div>
        <table class="table table-condensed"  width="400px">
            <tbody>
                <tr>
                    <td>
                        @(Html.RawFor(obj => obj.Ttile))
                    </td>
                    <td>
                        @Html.TextBoxFor(obj => obj.Ttile)
                    </td>
                </tr>
                   <tr>
                    <td>
                        @(Html.RawFor(obj => obj.SuperiorId))
                    </td>
                    <td>
                      @Html.DoubleDialog(obj => obj.SuperiorId, Url.Action("FolderTree"), Model.SuperiorName)
                    </td>
                </tr>
               
                <tr>
                    <td>
                    </td>
                    <td >
                        @Html.Submit(" 保 存 ", new { id = "addfolder", onclick = "return OnEditFolder()" })
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
}
<script>
    function OnEditFolder()
    {
        $("#DoEditFolderId").submit();
        return false;
    }
    function InitializeTipsEditFolder(obj) 
    {
        if (obj.Status == 1) 
        {
            $.tips("保存成功");
            getCurrentDialog($("#addfolder")).close();
            RefreshForm("-1");
        } else {
            $.tips(obj.ErrorText);
        }
    }
</script>
